<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HelloWorld!</title>
    <link rel="stylesheet" href="../../res/layui/css/layui.css">
</head>
<body>
<script src="../../res/layui/layui.js"></script>
<script>
    layui.use(['layer'], function () {
        var layer = layui.layer;
        layer.msg('Hello World!');

        var currentDeviceInfo = layui.device();
        console.log(currentDeviceInfo)
    });

    layui.use(['layer'], function (layer) { /*效果相同*/
        layer.msg('Hello World!');

        var currentDeviceInfo = layui.device();
        console.log(currentDeviceInfo)
    });
</script>
</body>
</html>